<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="/res/back/css/base.css" rel="stylesheet" type="text/css" />
<link href="/res/third/bootstrap3/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="/res/common/js/jquery.1.9.1.min.js" type="text/javascript"></script>
<script src="/res/third/bootstrap3/bootstrap.autocomplete.js" type="text/javascript"></script>
<script src="/res/third/artDialog/jquery.artDialog.js" type="text/javascript"></script>
<script src="/res/third/validate/jquery.validate.js" type="text/javascript"></script>
<script src="/res/third/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/res/third/easyUI/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script type="text/javascript" src="/res/third/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/res/third/ueditor/ueditor.all.js"></script>
<script type="text/javascript" src="/res/third/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
	
</script>
<style type="text/css">
</style>

</head>

<body>
<div style="height:100%;overflow-y:scroll">
<form id="addform" method="post" action="/msg/o_add.do" class="form-horizontal" role="form">
	<table class="table table-hover table-bordered">
		<tr>
			<th>消息名称</th>
			<td><input class="form-control" name="name" required="required"/></td>
			<th>消息描述</th>
			<td><input class="form-control" name="descr"/></td>
		</tr>
		<tr>
			<th>消息标题</th>
			<td><input class="form-control"  required="required" name="title"/></td>
			<th>消息代码</th>
			<td><input class="form-control"  required="required" name="code"/></td>
		</tr>
		<tr>
			<th>消息类型</th>
			<td><select class="form-control" name="msgType">
					[#list dictionarys as dictionary]
					<option value="${dictionary.code}">${dictionary.name!}</option>
					[/#list]
				</select></td>
			<th>用户类型</th>
			<td>
				<select class="form-control" name="roleType">
					<option value="">无</option>
					<option value="0">采供双方</option>
					<option value="1">采购商</option>
					<option value="2">供应商</option>
				</select>
			</td>
		</tr>
		<tr>
			<th>接收方式</th>
			<td><input type="checkbox"  name="sendtype" value="mobile" required minlength="1">短信
				<input type="checkbox"  name="sendtype" value="email">邮件
				<input type="checkbox"  name="sendtype" value="mail">站内信</td>
			<th>是否默认</th>
			<td><input type="checkbox" name="ifDefault" value="1">默认接收</td>
		</tr>
		<tr>
			<th>短信接口<br/><br/><br/>指定发送手机号</th>
			<td><input type="radio" name="interfaceType" value="1" required="required">乾景通
				<input type="radio" name="interfaceType" value="2">螺丝帽
				<br/>
				<br/>
				<br/>
				<input class="form-control"  name="appointTels"  placeholder="填写手机号，用逗号分隔"/>
			</td>
			<th>手机消息内容</th>
			<td><textarea style="height:100px" class="form-control" name="telContent"></textarea></td>
		</tr>
		<tr>
			<th>邮件消息内容</th>
			<td colspan="3"><script id="container2" name="emailContent" type="text/plain"></script></td>
		</tr>
		<tr>
			<th>站内信消息内容</th>
			<td colspan="3"><script id="container3" name="mailContent" type="text/plain"></script></td>
		</tr>
	</table>
</form>
<div class="center-block">
	<button class="btn btn-success" onclick="addmsg()">提交</button>
</div>
</div>
</body>
</html>
<script type="text/javascript">
	$().ready(function() {
	    $("#addform").validate();
	});

	var editor;
	$(function() {

		var option = {
			theme : "default",
			lang : "zh-cn",
			initialFrameWidth : 800,
			initialFrameHeight : 150,
			autoHeightEnabled : false,
			pasteplain : true,//默认纯文本格式粘贴,
			elementPathEnabled : false,
			focus : false,//初始化时不让编辑器获取焦点
			toolbars : [ [ 'fullscreen', 'source', 'undo', 'redo', 'bold',
					'indent', 'italic', 'underline', 'strikethrough',
					'justifyleft', 'justifyright', 'justifycenter',
					'justifyjustify', 'rowspacingtop', 'rowspacingbottom',
					'lineheight', 'removeformat', '|', 'fontfamily',
					'fontsize', 'forecolor', 'backcolor', 'insertorderedlist',
					'insertunorderedlist', 'insertimage', 'emotion',
					'inserttable', 'mergeright', 'mergedown', 'deleterow',
					'deletecol', 'splittorows', 'splittocols', 'splittocells',
					'deletecaption', 'mergecells', 'deletetable' ] ]
		};
		editor = UE.getEditor('container', option);
		editor = UE.getEditor('container2', option);
		editor = UE.getEditor('container3', option);
		$("span[class='combo']").css({
			"height" : "30px",
			"border-radius" : "4px",
			"width" : "180px"
		});
		$("span[class='combo-arrow']").css({
			"height" : "30px"
		});
		$("input[class^='combo-text']").css({
			"height" : "30px",
			"width" : "160px"
		});

	});

	function addmsg() {
		
		$("#addform").submit();
	};

</script>
